import java.util.*;

public class MarbleDecoration {
	public int maxLength(int R, int G, int B) {
		int ret = solve(R,G);
        ret = Math.max(ret, solve(R,B));
        ret = Math.max(ret, solve(G,B));
        return ret;
	}

    private static int solve(int a, int b){
        return 2 * Math.min(a,b) + (int)Math.signum(Math.max(a, b)- Math.min(a,b));
    }
}
